package cn.xxi.ai.config;

import io.minio.MinioClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * MinIO 客户端配置类
 * 根据配置属性初始化 MinioClient Bean
 * 
 * @author bingo
 */
@Configuration
public class MinioConfigurer {

    private final MinioProperties minioProperties;

    public MinioConfigurer(MinioProperties minioProperties) {
        this.minioProperties = minioProperties;
    }

    @Bean
    public MinioClient minioClient() {
        return MinioClient.builder()
                .endpoint(minioProperties.getEndpoint())
                .credentials(minioProperties.getAccessKey(), minioProperties.getSecretKey())
                .build();
    }
}
